import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:number_spark_flutter/routes/ns_app_pages.dart';
import 'package:number_spark_flutter/style/ns_style.dart';
import 'package:number_spark_flutter/widgets/brick/ns_brick.dart';

class SingleCorrectDialog extends StatelessWidget {
  const SingleCorrectDialog({super.key, required this.correctAnswer, required this.onClickOk});

  final String correctAnswer;
  final Function onClickOk;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.transparent,
      body: Center(
        child: IntrinsicHeight(
          child: Stack(
            alignment: Alignment.center,
            children: [
              Stack(
                alignment: Alignment.topRight,
                children: [
                  NSImage(
                    assetImage: 'img_bg_single_result_dialog.png',
                    width: 305.w,
                    height: 233.w,
                  ),
                  NSImage(
                    margin: EdgeInsets.only(top: 7.w, right: 7.w),
                    assetImage: 'icon_dialog_close.png',
                    width: 34.w,
                    onTap: () {
                      Get.until((route) => route.settings.name == NSRoutes.main);
                    },
                  )
                ],
              ),
              NSColumn(
                height: 233.w,
                children: [
                  NSText(
                    margin: EdgeInsets.only(top: 60.w),
                    text: 'Correct answer',
                    fontSize: 20.sp,
                    fontFamily: 'LilitaOne-Regular',
                    textColor: kAppColor('#A04B10'),
                  ),
                  NSText(
                    margin: EdgeInsets.only(top: 16.w),
                    text: correctAnswer,
                    fontSize: 48.sp,
                    fontFamily: 'LilitaOne-Regular',
                    textColor: kAppColor('#733904'),
                  ),
                  NSImage(
                    margin: EdgeInsets.only(top: 24.w),
                    assetImage: 'img_bg_single_ok_btn.png',
                    width: 121.w,
                    onTap: () {
                      onClickOk();
                    },
                  )
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}
